package net.bungaeting.client.android.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import android.app.Activity;
import android.content.Context;
import android.telephony.TelephonyManager;

public class ServiceUtil {
	public static String makeRequestId(String serviceId){
		Calendar cal = Calendar.getInstance();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
		String time = sdf.format(cal.getTime());
		return time;
	}
	private static String clientId;
	public static String getClientId(){
		return clientId;
	}
	public static String getClientId(Activity activity){
		if (clientId == null){
			TelephonyManager telephonyManager = (TelephonyManager)activity.getSystemService(Context.TELEPHONY_SERVICE);
			clientId = telephonyManager.getLine1Number();
		}
		
		return clientId;
	}
}
